#ifndef __UI_H_
#define __UI_H_
#include "main.h"
#include "userheader.h"
#include "lcd.h"
#include "touch.h"

//--------------------------------显示部分--------------------------------------------------------------------
#define mainMenu 0
#define coorCtrl 1
#define setMenu 2
#define outFrameCtrl 3
#define innFrameCtrl 4
#define adjustMenu 5
#define aboutUs 6
#define homeSet 7
#define cornerSet 8
#define numKeyPad 9

extern UiControlDef UI;
extern TouchPointDef Touch;

//UI显示
void uidraw(int index);
void drawCornerVoord(void);
void frawCornerName(void);
void drawPosInfor(void);
void PosInforName(void);

//--------------------------------触摸部分--------------------------------------------------------------------

#define Touch_Init() 	tp_dev.init() //触摸屏初始化
#define Touch_read()	tp_dev.scan(1) // 触摸屏坐标读取
#define Touch_X 		(int)(((float)tp_dev.x[0]/8.5)*96.0/89.0-1920.0/89.0) //触摸x坐标读取
#define Touch_Y 		(int)(320-(((float)tp_dev.y[0]/13.0)*8.0/7.0-208.0/7.0)-15) //触摸y坐标读取



//触摸判决函数
int touchJudge(TouchPointDef* touchpointh);
//触摸码获取函数
int getTouchCode(int uiIndex);
//设置反馈函数
void setFeedBack(void);
#endif
